

CREATE TABLE users (
	username VARCHAR(50) NOT NULL PRIMARY KEY,
	password VARCHAR(50) NOT NULL,
	enabled BOOLEAN NOT NULL
);

CREATE TABLE authorities (
	username VARCHAR(50) NOT NULL,
	authority VARCHAR(50) NOT NULL
);

CREATE UNIQUE INDEX ix_auth_username ON authorities (username, authority);

ALTER TABLE authorities ADD CONSTRAINT fk_authorities_users foreign key (username) REFERENCES users(username);


INSERT INTO users VALUES ('david', 'newyork', true);
INSERT INTO users VALUES ('alex', 'newjersey', true);
INSERT INTO users VALUES ('tim', 'illinois', true);

INSERT INTO authorities VALUES ('david', 'ROLE_USER');
INSERT INTO authorities VALUES ('david', 'ROLE_ADMIN');
INSERT INTO authorities VALUES ('alex', 'ROLE_USER');
INSERT INTO authorities VALUES ('tim', 'ROLE_USER');

INSERT INTO `pos_employee` (`employee_id`, `created_by`, `created_date`, `last_modified_by`, `last_modified_date`, `city`, `country`, `house_number`, `pincode`, `street_name`, `first_name`, `account_expired`, `account_locked`, `password_expired`, `enabled`, `last_name`, `monthly_salary`, `nick_name`, `password`, `title`, `user_name`) VALUES
(1, 'admin', '2015-04-09 09:11:36', 'admin', '2015-04-09 06:11:36', 'CHANDRA', NULL, 0, '332323', NULL, 'CHANDRA', b'0', b'0', b'0', b'1', 'SHEKHER', NULL, NULL, '$2a$10$zbbiEBt9IIqGqey7KBCWcOtuFibYohAALM73YTCgBZ7gE4x5OyJtK', NULL, 'chandra'),
(2, 'admin', '2015-04-09 09:14:01', 'admin', '2015-04-09 06:14:01', 'bangalore', NULL, 0, '33232', NULL, 'chandra', b'0', b'0', b'0', b'1', 'shekher', NULL, NULL, '$2a$10$ZCdsLX2C39INoDsLPmVpluA.3ZTnIhi60EaajBj0iS1RfoYpI2tSm', NULL, 'admin');